<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .father {
      width: 300px;
      height: 300px;
      background-color: lightblue;
    }
    .son {
      width: 100px;
      height: 100px;
      background-color: lightcoral;
    }
  </style>
</head>
<body>
  <div id="app">
    <h2>事件修饰符</h2>
    <form action="" v-on:submit.prevent="fn">
      <input type="text">
      <input type="submit">
    </form>


    <hr>


    <div class="father" @click="fatherClick">
      <div class="son" @click.stop="sonClick"></div>
    </div>
  </div>


  <script src="../vue3.js"></script>
  <script>
    // .stop  阻止事件冒泡
    // .prevent  阻止默认行为
    // .self
    // .capture
    // .once
    // .passive
    const {createApp} = Vue;
    createApp({
      data() {
        return {}
      },
      methods: {
        // fn(event) {
        //   event.preventDefault();
        // }
        fn() {
          console.log(123);
        },
        fatherClick() {
          console.log("fatherClick");
          
        },
        sonClick() {
          console.log("sonClick");
          
        }
      }
    }).mount("#app");
  </script>
</body>
</html>